<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head >
    <title>搜索管理后台 - 其它信息管理</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="${request.contextPath}/css/style_manager.css">
	<script type="text/javascript" src="${request.contextPath}/js/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="${request.contextPath}/js/manager.js"></script>
	<script type="text/javascript" src="${request.contextPath}/js/my97/WdatePicker.js"></script>
	<script type="text/javascript" src="${request.contextPath}/js/jquery.overblock-1.2.js"></script>
		
	<script type="text/javascript">
	var ctype = '';
	$(function(){
		var ctype = $('#queryCateType').val();
		$('#cateType').find('option[value="'+ctype+'"]').attr('selected', 'selected');
		
		$('#closeCate').click(function(){
			$('#addCateInfo').hidePop();
		});
		
		$('.cateTr:gt(0)').hover(function(){
			$(this).addClass('trOn');
		}, function(){
			$(this).removeClass('trOn');
		});
		
		initPage();
	});
	function queryCates(thisObj){
		var t = $(thisObj).val();
		$('#queryCateType').val(t);
		$('#pageNum').val(1);
		$('#queryForm').submit();
	}
	
	function deleteCate(thisObj){
		if(!confirm('删除该类别以后，原属于该类别的关键词都将重置于对应词库的“未分类”类别下，是否继续删除？')){
			return;
		}
		var tr = $(thisObj).parents('tr.cateTr');
		var id = tr.find('.cateId').val();
		ajax('cateDel?ids='+id, function(){
			tr.remove();
		});
	}
	
	function addCate(){
		$('#addCateInfo').showPop();
	}
	
	function reloadPage(){
		$('#queryForm').submit();
	}
	
	function initPage(){
		var total = $('#total').val() -0;
		var pn = Math.ceil(total/15);
		var p = $('#pageNum').val();
		var h = '';
		if(p > 1){
			h += '<a href="javascript:void(0);" onclick="prev();">上一页</a>&nbsp;';
		}
		if(p < pn){
			h += '<a href="javascript:void(0);" onclick="next();">下一页</a>';
		}
		$('#pageHtml').html(h);
	}
	function prev(){
		var p = $('#pageNum').val();
		$('#pageNum').val(p - 1);
		$('#queryForm').submit();
	}
	function next(){
		var p = $('#pageNum').val();
		$('#pageNum').val(p - 0 + 1);
		$('#queryForm').submit();
	}
	</script>
	<style type="text/css">
	#cateType{
		padding:2px;
		border-radius:5px;
	}
	.cdivMenu a{
		text-decoration:none;
	}
	#userMgr a,#themeMgr a{
		color:#dddddd;
	}
	#dataTable{
		margin-left:60px;
		width:700px;
	}
	#dataTable td{
		line-height:25px;
		font-size:13px;
		padding-left:40px;
	}
	#title td{
		font-size:14px;
		font-weight:bold;
		background-color:#2157D7;
		color:white;
	}
	.trOn{
		background-color:white;
	}
	</style>
  </head>
  <body>
  	<form id="queryForm" action="${request.contextPath}/manager/cateIndex" method="post">
  		<input type="hidden" name="t" value="${t}" id="queryCateType" />
  		<input type="hidden" name="total" value="${total}" id="total" />
  		<input type="hidden" name="p" value="${p}" id="pageNum" />
  		<input type="hidden" value="${t}" id="CATEINFOTYPE" />
  	</form>
  	<div style="margin-top:30px;margin-left:22px;">
		<h3>其它信息管理</h2>
  	</div>
  	<div style="width:950px;height:auto;margin:auto; ">
  		<table id="table1">
  			<tr height="40">
  				<td style="width:180px;">
  					<div class="cdivMenu menuSelected" id="cateMgr">
  						<a href="cateIndex">词 库 类 别 管 理</a>
  					</div>
  				</td>
  				<td style="width:170px;">
  					<div class="cdivMenu" id="userMgr">
  						<a href="userIndex">用 户 信 息 管 理</a>
  					</div>
  				</td>
  				<td style="width:170px;">
  					<div class="cdivMenu" id="themeMgr">
  						<a href="themeIndex">主 题 商 品 管 理</a>
  					</div>
  				</td>
  				<td width="430">&nbsp;</td>
  			</tr>
  			<tr>
  				<td colspan="4">
  					<div class="divBox">
  						<div id="cateBox" class="divBox0">
							<div id="cateListTTT">
								<select id="cateType" onchange="queryCates(this);">
									<option value="base_word">总词库分类信息</option>
									<option value="same_word">同义库分类信息</option>
									<option value="industry_word">行业词库分类信息</option>
									<option value="test_word">评测词库分类信息</option>
									<option value="hot_word">热门词库分类信息</option>
									<option value="tag_word">标签库分类信息</option>
								</select>
								<a href="javascript:void(0);" style="margin-left:30px;font-size:13px;" onclick="addCate();">
									新增分类
								</a>
								<span id="pageHtml" style="font-size:13px;margin-left:100px;"></span>
								<div style="margin-top:30px;">
  		<#if cates?exists && (cates?size>0) >
  			<table id="dataTable" style="border-collapse:collapse;">
  				<tr id="title">
  					<td>
  						名称
  					</td>
  					<td>
  						添加时间
  					</td>
  					<td>
  						操作
  					</td>
  				</tr>
			<#list cates as cate>
  				<tr class="cateTr">
  					<td><input type="hidden" class="cateId" value="${cate.id}" />
				${cate.name}
  					</td>
  					<td>
				${cate.addTimeStr}
  					</td>
  					<td>
  						<#if cate.name != "未分类">
							<a href="javascript:void(0);" onclick="deleteCate(this);">删除</a>
							<#else>
							<span style="color:#aaaaaa;">删除</span>
  						</#if>
  					</td>
  				</tr>
			</#list>
			</table>
			<#else>
			<div>没有数据</div>
  		</#if>
								</div>
							</div>
  						</div>
  					</div>
  				</td>
  			</tr>
  		</table>
  	</div>
  	<#include "../cate_float.ftl" />
  </body>
</html>
